using System;
using System.Collections.Generic;
using System.Text;
using ACS.Compiler.Grammar.Impl;
using ACS.Compiler.Util;

namespace ACS.Compiler.Tree.Impl
{
    public class SimpleTypeDeclarer : TypeDeclarer
    {
        public override void Build()
        {
            switch (((TreeBase)getFirstChild()).Token.Type)
            {
                case AcsParser.KEYWORD_BOOL:
                    _tag = Tags.Bool;
                    break;
                case AcsParser.KEYWORD_INT:
                    _tag = Tags.Int;
                    break;
                case AcsParser.KEYWORD_STRING:
                    _tag = Tags.String;
                    break;
                default:
                    Logger.Instance.TraceError("Wrong token in type declarer", this);
                    break;
            }
        }
    }
}
